﻿using System;

namespace EmbeddedSharp.Core.Function.Logic {
    public class NotNode : UnaryOperatorNode {

        /// <summary>
        /// !
        /// </summary>
        public NotNode()
            : base() {
            this.Value = "!";
            this.Precedence = -1;
        }

        public override FuncNode GetReversedFunction(int index) {
            throw new NotImplementedException();
        }

        public override object Evaluate() {
            string lr = Operand.Evaluate().ToString();

            return !Convert.ToBoolean(lr);
        }
    }
}
